package com.gdupt.entity.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResponseData {
    private int code;  //0  success 1 fail
    private String msg;
    private long count;
    private Object data;


    public static ResponseData okPage(long count, Object data) {
        return new ResponseData(0, null, count, data);
    }

    //public static ResponseData okPages(long count, Object data,String msg){ return new ResponseData(0,msg,null,data); }

    public static ResponseData okData(long count, Object data){ return new ResponseData(0,"",count,data);}

    public static ResponseData okMsg(String msg){ return new ResponseData(0, msg, 0, null); }

    public static ResponseData failMsg(String msg) { return new ResponseData(1, msg, 0, null); }

    public static ResponseData okDatas(Object data){return new ResponseData(0,"",0,data);}
	
	public static ResponseData okSingleData(Object data){ return new ResponseData(0,"",1,data); }

}
